<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Event.Windows.Thread</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-4"></span><span>    </span><span class="annot"><a href="GHC.Event.Windows.Thread.html#ensureIOManagerIsRunning"><span class="hs-identifier">ensureIOManagerIsRunning</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-5"></span><span>    </span><span class="annot"><a href="GHC.Event.Windows.Thread.html#interruptIOManager"><span class="hs-identifier">interruptIOManager</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-6"></span><span>    </span><span class="annot"><a href="GHC.Event.Windows.Thread.html#threadDelay"><span class="hs-identifier">threadDelay</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-7"></span><span>    </span><span class="annot"><a href="GHC.Event.Windows.Thread.html#registerDelay"><span class="hs-identifier">registerDelay</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Conc.Sync.html"><span class="hs-identifier">GHC.Conc.Sync</span></a></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Event.Windows.html"><span class="hs-identifier">GHC.Event.Windows</span></a></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.html"><span class="hs-identifier">GHC.IO</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IOPort.html"><span class="hs-identifier">GHC.IOPort</span></a></span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="annot"><a href="GHC.Event.Windows.Thread.html#ensureIOManagerIsRunning"><span class="hs-identifier hs-type">ensureIOManagerIsRunning</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span id="ensureIOManagerIsRunning"><span class="annot"><span class="annottext">ensureIOManagerIsRunning :: IO ()
</span><a href="GHC.Event.Windows.Thread.html#ensureIOManagerIsRunning"><span class="hs-identifier hs-var hs-var">ensureIOManagerIsRunning</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="GHC.Event.Windows.html#wakeupIOManager"><span class="hs-identifier hs-var">wakeupIOManager</span></a></span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="annot"><a href="GHC.Event.Windows.Thread.html#interruptIOManager"><span class="hs-identifier hs-type">interruptIOManager</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-20"></span><span id="interruptIOManager"><span class="annot"><span class="annottext">interruptIOManager :: IO ()
</span><a href="GHC.Event.Windows.Thread.html#interruptIOManager"><span class="hs-identifier hs-var hs-var">interruptIOManager</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="GHC.Event.Windows.html#interruptSystemManager"><span class="hs-identifier hs-var">interruptSystemManager</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="annot"><a href="GHC.Event.Windows.Thread.html#threadDelay"><span class="hs-identifier hs-type">threadDelay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span id="threadDelay"><span class="annot"><span class="annottext">threadDelay :: Int -&gt; IO ()
</span><a href="GHC.Event.Windows.Thread.html#threadDelay"><span class="hs-identifier hs-var hs-var">threadDelay</span></a></span></span><span> </span><span id="local-6989586621679553843"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679553843"><span class="hs-identifier hs-var">usecs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO ()
forall a. IO a -&gt; IO a
</span><a href="GHC.IO.html#mask_"><span class="hs-identifier hs-var">mask_</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-24"></span><span>    </span><span id="local-6989586621679553841"><span class="annot"><span class="annottext">IOPort ()
</span><a href="#local-6989586621679553841"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (IOPort ())
forall a. IO (IOPort a)
</span><a href="GHC.IOPort.html#newEmptyIOPort"><span class="hs-identifier hs-var">newEmptyIOPort</span></a></span><span>
</span><span id="line-25"></span><span>    </span><span id="local-6989586621679553839"><span class="annot"><span class="annottext">Manager
</span><a href="#local-6989586621679553839"><span class="hs-identifier hs-var">mgr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Manager
</span><a href="GHC.Event.Windows.html#getSystemManager"><span class="hs-identifier hs-var">getSystemManager</span></a></span><span>
</span><span id="line-26"></span><span>    </span><span id="local-6989586621679553837"><span class="annot"><span class="annottext">TimeoutKey
</span><a href="#local-6989586621679553837"><span class="hs-identifier hs-var">reg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Manager -&gt; Int -&gt; IO () -&gt; IO TimeoutKey
</span><a href="GHC.Event.Windows.html#registerTimeout"><span class="hs-identifier hs-var">registerTimeout</span></a></span><span> </span><span class="annot"><span class="annottext">Manager
</span><a href="#local-6989586621679553839"><span class="hs-identifier hs-var">mgr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679553843"><span class="hs-identifier hs-var">usecs</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO TimeoutKey) -&gt; IO () -&gt; IO TimeoutKey
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IOPort () -&gt; () -&gt; IO Bool
forall a. IOPort a -&gt; a -&gt; IO Bool
</span><a href="GHC.IOPort.html#writeIOPort"><span class="hs-identifier hs-var">writeIOPort</span></a></span><span> </span><span class="annot"><span class="annottext">IOPort ()
</span><a href="#local-6989586621679553841"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO Bool -&gt; IO () -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span>    </span><span class="annot"><span class="annottext">IOPort () -&gt; IO ()
forall a. IOPort a -&gt; IO a
</span><a href="GHC.IOPort.html#readIOPort"><span class="hs-identifier hs-var">readIOPort</span></a></span><span> </span><span class="annot"><span class="annottext">IOPort ()
</span><a href="#local-6989586621679553841"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO () -&gt; IO ()
forall a b. IO a -&gt; IO b -&gt; IO a
</span><a href="GHC.IO.html#onException"><span class="hs-operator hs-var">`onException`</span></a></span><span> </span><span class="annot"><span class="annottext">Manager -&gt; TimeoutKey -&gt; IO ()
</span><a href="GHC.Event.Windows.html#unregisterTimeout"><span class="hs-identifier hs-var">unregisterTimeout</span></a></span><span> </span><span class="annot"><span class="annottext">Manager
</span><a href="#local-6989586621679553839"><span class="hs-identifier hs-var">mgr</span></a></span><span> </span><span class="annot"><span class="annottext">TimeoutKey
</span><a href="#local-6989586621679553837"><span class="hs-identifier hs-var">reg</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="annot"><a href="GHC.Event.Windows.Thread.html#registerDelay"><span class="hs-identifier hs-type">registerDelay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Conc.Sync.html#TVar"><span class="hs-identifier hs-type">TVar</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span id="registerDelay"><span class="annot"><span class="annottext">registerDelay :: Int -&gt; IO (TVar Bool)
</span><a href="GHC.Event.Windows.Thread.html#registerDelay"><span class="hs-identifier hs-var hs-var">registerDelay</span></a></span></span><span> </span><span id="local-6989586621679553831"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679553831"><span class="hs-identifier hs-var">usecs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-31"></span><span>    </span><span id="local-6989586621679553830"><span class="annot"><span class="annottext">TVar Bool
</span><a href="#local-6989586621679553830"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO (TVar Bool)
forall a. a -&gt; IO (TVar a)
</span><a href="GHC.Conc.Sync.html#newTVarIO"><span class="hs-identifier hs-var">newTVarIO</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-32"></span><span>    </span><span id="local-6989586621679553828"><span class="annot"><span class="annottext">Manager
</span><a href="#local-6989586621679553828"><span class="hs-identifier hs-var">mgr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Manager
</span><a href="GHC.Event.Windows.html#getSystemManager"><span class="hs-identifier hs-var">getSystemManager</span></a></span><span>
</span><span id="line-33"></span><span>    </span><span class="annot"><span class="annottext">TimeoutKey
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Manager -&gt; Int -&gt; IO () -&gt; IO TimeoutKey
</span><a href="GHC.Event.Windows.html#registerTimeout"><span class="hs-identifier hs-var">registerTimeout</span></a></span><span> </span><span class="annot"><span class="annottext">Manager
</span><a href="#local-6989586621679553828"><span class="hs-identifier hs-var">mgr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679553831"><span class="hs-identifier hs-var">usecs</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO TimeoutKey) -&gt; IO () -&gt; IO TimeoutKey
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">STM () -&gt; IO ()
forall a. STM a -&gt; IO a
</span><a href="GHC.Conc.Sync.html#atomically"><span class="hs-identifier hs-var">atomically</span></a></span><span> </span><span class="annot"><span class="annottext">(STM () -&gt; IO ()) -&gt; STM () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TVar Bool -&gt; Bool -&gt; STM ()
forall a. TVar a -&gt; a -&gt; STM ()
</span><a href="GHC.Conc.Sync.html#writeTVar"><span class="hs-identifier hs-var">writeTVar</span></a></span><span> </span><span class="annot"><span class="annottext">TVar Bool
</span><a href="#local-6989586621679553830"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-34"></span><span>    </span><span class="annot"><span class="annottext">TVar Bool -&gt; IO (TVar Bool)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TVar Bool
</span><a href="#local-6989586621679553830"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span></pre></body></html>